package com.kly.sc.api.application.config;

import com.kly.sc.api.application.interceptors.AccessInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2017/7/10
 * Time: 下午7:43
 */
@Configuration
public class InterceptorsConfig extends WebMvcConfigurerAdapter {
    @Autowired
    private AccessInterceptor userAccessRightInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userAccessRightInterceptor).addPathPatterns("/**");
    }
}
